package com.ssy.jt808.gateway.sdk.terminal.constant.location.addition;

import java.util.Map;
import java.util.TreeMap;

/**
 * 激烈驾驶（Aggressive driving， 0x70）
 *
 * @author wangzezhou
 */
public enum AdAlarmEnum{

  /** 急加速 */
  RapidlyAccelerate(0x01),

  /** 急减速 */
  AbruptlyDecelerate(0x02);

  AdAlarmEnum( int type ){
    this.type = type;
  }

  private final int type;

  public int type(){
    return type;
  }


  private static final Map<Integer,AdAlarmEnum> TYPE_MAP;

  static{
    TYPE_MAP = new TreeMap<>();
    AdAlarmEnum[] values = AdAlarmEnum.values();
    for(AdAlarmEnum value : values){
      TYPE_MAP.put(value.type(), value);
    }
  }

  public static AdAlarmEnum type( int type ){
    AdAlarmEnum DsmAlarmEnum = TYPE_MAP.get(type);
    assert DsmAlarmEnum != null;
    return DsmAlarmEnum;
  }
}
